package com.liujit.validator.constants;

import java.util.regex.Pattern;

/**
 * @author: liujun
 * @date: 2021/6/22 1:27 下午
 * @description: 正则表达式
 */
public interface PatternConstant {

    /**
     * 账号
     */
    Pattern ACCOUNT = Pattern.compile("^[a-zA-Z]\\w{4,15}$");

    /**
     * 身份证号
     */
    Pattern ID_CARD = Pattern.compile(
            "(^\\d{8}(0\\d|10|11|12)([0-2]\\d|30|31)\\d{3}$)|(^\\d{6}(18|19|20)\\d{2}(0[1-9]|10|11|12)([0-2]\\d|30|31)\\d{3}(\\d|X|x)$)");

    /**
     * 手机号
     */
    Pattern MOBILE = Pattern.compile(
            "^(?:(?:\\+|00)86)?1(?:(?:3[\\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\\d])|(?:9[189]))\\d{8}$");

    /**
     * 密码
     */
    Pattern PWD = Pattern
            .compile("^\\S*(?=\\S{6,})(?=\\S*\\d)(?=\\S*[A-Z])(?=\\S*[a-z])(?=\\S*[!@#$%^&*? ])\\S*$");
}
